﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace HdipCricketClub.Models
{
     
    [MetadataType(typeof(MemberMetaData))]
    public partial class Member
    {
        public string FirstAndLastName
        {
            get
            {
                return first_name + " " + last_name;
            }
        }

        public string InitialAndLastName
        {
            get
            {
                return first_name.Substring(0, 1) + ". " + last_name;
            }
        }



    }

    public class MemberMetaData
    {
        public object member_id;

        [Required(ErrorMessage = "First name is required.")]
        [StringLength(30, ErrorMessage = "Maximum first name length is 30 characters")]
        [Display(Name = "First Name:")]
        public object first_name;

        [Required(ErrorMessage = "Last name is required.")]
        [StringLength(30, ErrorMessage = "Maximum last name length is 30 characters")]
        [Display(Name = "Last Name:")]
        public object last_name;

        
        
        [DataType(DataType.Date, ErrorMessage = "Incorrect data format")]
        [Display(Name = "Date of Birth:")]
        public object DOB;

        [Required(ErrorMessage = "Street address is required.")]
        [StringLength(30, ErrorMessage = "Maximum address length 30 characters")]
        [Display(Name = "Street 1:")]
        public object address_1;

        [Display(Name = "Street 2:")]
        [StringLength(30, ErrorMessage = "Maximum address length 30 characters")]
        public object address_2;

        [Required(ErrorMessage = "A town or city is required.")]
        [StringLength(30, ErrorMessage = "Maximum town or city length 30 characters")]
        [Display(Name = "Town / City:")]
        public object town_city;

        [Required(ErrorMessage = "A county is required.")]
        [Display(Name = "County:")]
        public object county;

        [Required(ErrorMessage = "A Mobile number is required")]
        [Display(Name = "Mobile Number:")]
        [DataType(DataType.PhoneNumber)]
        public object mobile;

        [Required(ErrorMessage = "A phone number required.")]
        [DataType(DataType.PhoneNumber)]
        [Display(Name = "Phone Number:")]
        public object phone;

        [Required(ErrorMessage = "An E Mail address is required.")]
        [Display(Name = "E Mail Address:")]
        [DataType(DataType.EmailAddress, ErrorMessage = "Incorrect E Mail address.")]
        public object email;

        [Display (Name = "Playing Member:")]
        public object playing_member;
    }


}